package com.feiyun.erp.mapper;

import com.feiyun.erp.entity.Functions;
import com.feiyun.erp.entity.Role;
import com.feiyun.erp.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xray
 * @since 2021-05-03
 */
public interface UserMapper extends BaseMapper<User> {

    /**
     * 根据用户名查询该用户的角色
     * @param username
     * @return
     */
    List<Role> selectRolesByUsername(String username);

    /**
     * 根据用户名查询权限
     * @param username
     * @return
     */
    List<Functions> selectFunctionsByUsername(String username);

    /**
     * 根据用户名查询所有上下级权限
     * @param username
     * @return
     */
    List<Functions> selectFunctionsAndSubFunctionsByUsername(String username);
}
